package pers.amos.dubbo.adaptive;

import org.apache.dubbo.common.URL;
import org.apache.dubbo.common.extension.ExtensionLoader;
import org.apache.dubbo.remoting.RemotingException;
import org.apache.dubbo.remoting.Transporter;

/**
 * @author amos wong
 * @create 2020-12-04 11:43 上午
 */

public class TransporterAdaptiveTest {

    public static void main(String[] args) {
        ExtensionLoader<Transporter> extensionLoader =
                ExtensionLoader.getExtensionLoader(Transporter.class);

        Transporter nettyTransporter = extensionLoader.getAdaptiveExtension();

        URL url = new URL("dubbo", "127.0.0.1", 10086);
        try {
            nettyTransporter.connect(url, null);
        } catch (RemotingException e) {
            e.printStackTrace();
        }
    }
}
